﻿using Forum.Model.Entity.System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Forum.Model.Response
{
    public class TokenResponse
    {
        public string token { get; set; }
        //token过期时间
        public DateTime expiration { get; set; }

        public string refresh_token { get; set; }
        //token过期时间
        public DateTime refresh_exp { get; set; }
    }

    public class UserLoginInfo
    {
        public SYS_USER user { get; set; }
        public TokenResult token { get; set; }
    }

    public class TokenResult
    {
        public bool Success => string.IsNullOrWhiteSpace(Errors);
        public string Errors { get; set; }

        public string AccessToken { get; set; }

        public string TokenType { get; set; }

        public int ExpiresIn { get; set; }   // add

        public DateTime Expiration { get; set; }

        public string RefreshToken { get; set; }  // add
    }

    public class RefreshTokenReq
    {
        public string token { get; set; }
        public string refreshToken { get; set; }
    }
}
